package states 
{
	import model.MGameboard;
	import model.MSpaceship;
	import statemachine.IState;
	import statemachine.IStateObject;
	
	/**
	 * ...
	 * @author vkozhaev
	 */
	public class GetResourcesState extends State implements IState
	{
		public static const NAME:String = "get_resources_state";
		private var _mGameboard:MGameboard;
		
		
		public function GetResourcesState(_stateObject:IStateObject,_mGameboard:MGameboard) 
		{
			super(_stateObject)
			this._name = NAME;
			this._ticks = SetParameters.ASTEROID_PROCESS_TIME;
			this._mGameboard = _mGameboard;
		}
		
		override public function doInProcess():void
		{
			this._ticks--;
		}
		
		override public function doBefore():void 
		{
			trace("start asteriod processing");
		}
		
		override public function doAfter():void 
		{
			
			_mGameboard.removeAsteroid((_stateObject as MSpaceship).processedAsteroid);
		}
		
		
	}

}